
<template>
  <view class="page-container">
    <scroll-view scroll-y="true" class="page-body py-32 font-bold">
      <view class="box-shadows py-32 px-32 flex items-center justify-between mt-24" >
        <view class="font-bold">试卷名称</view>
        <view class="flex items-center text-gray">{{listData.categoryName}}</view>
      </view>
      <view class="box-shadows py-32 px-32 flex items-center justify-between mt-24" >
        <view class="font-bold">考试时间</view>
        <view class="flex items-center text-gray"><text class="text-primary">{{listData.mnksExamMaxTime}}</text><text class="ml-2">分钟</text></view>
      </view>
      <view class="box-shadows py-32 px-32 flex items-center justify-between mt-24" >
        <view class="font-bold">及格分</view>
        <view class="flex items-center text-gray"><text class="text-primary">{{listData.mnksExamPassScore}}</text><text class="ml-2">分</text></view>
      </view>
    </scroll-view>
    <view   @click="submit" class="font-32 text-ff bg-primary flex items-center justify-center h-100">开始考试</view>
  </view>
</template>
<script setup>
import { ref} from 'vue'
import {onLoad} from "@dcloudio/uni-app"
import utils from '@/utils/utils.js'
import  {subject} from '@/api'
import useUserStore from '@/store/user.js'
const useStore = useUserStore()
const listData = ref('')
onLoad((options)=>{
  console.log('options:', options)
   subject.getSubjectInfo({
     categoryId: options.id
  }).then(res => {
     if(res.code ===0){
       console.log(res)
        listData.value = res.data
       console.log(listData.value)
     }
  })
})
const submit = () => {
    uni.redirectTo({
      url: `/pages/index/SimulatedExam/Exam?categoryId=${listData.value.categoryId}&mnksExamMaxTime=${listData.value.mnksExamMaxTime}`
    })
}
</script>
<style scoped lang="scss">
</style>